// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod asset_service {
    use crate::Result;

    /// A builder for [AssetService][crate::client::AssetService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_asset_v1::*;
    /// # use builder::asset_service::ClientBuilder;
    /// # use client::AssetService;
    /// let builder : ClientBuilder = AssetService::builder();
    /// let client = builder
    ///     .with_endpoint("https://cloudasset.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::AssetService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = AssetService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::AssetService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [AssetService::export_assets][crate::client::AssetService::export_assets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::ExportAssets;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ExportAssets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ExportAssets(RequestBuilder<crate::model::ExportAssetsRequest>);

    impl ExportAssets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ExportAssetsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [export_assets][crate::client::AssetService::export_assets].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .export_assets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `export_assets`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<crate::model::ExportAssetsResponse, crate::model::ExportAssetsRequest>
        {
            type Operation = lro::internal::Operation<
                crate::model::ExportAssetsResponse,
                crate::model::ExportAssetsRequest,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [parent][crate::model::ExportAssetsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [read_time][crate::model::ExportAssetsRequest::read_time].
        pub fn set_read_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_time][crate::model::ExportAssetsRequest::read_time].
        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [asset_types][crate::model::ExportAssetsRequest::asset_types].
        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [content_type][crate::model::ExportAssetsRequest::content_type].
        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
            self.0.request.content_type = v.into();
            self
        }

        /// Sets the value of [output_config][crate::model::ExportAssetsRequest::output_config].
        ///
        /// This is a **required** field for requests.
        pub fn set_output_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::OutputConfig>,
        {
            self.0.request.output_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [output_config][crate::model::ExportAssetsRequest::output_config].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::OutputConfig>,
        {
            self.0.request.output_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [relationship_types][crate::model::ExportAssetsRequest::relationship_types].
        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ExportAssets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::list_assets][crate::client::AssetService::list_assets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::ListAssets;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListAssets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListAssets(RequestBuilder<crate::model::ListAssetsRequest>);

    impl ListAssets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListAssetsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListAssetsResponse> {
            (*self.0.stub)
                .list_assets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListAssetsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListAssetsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListAssetsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [read_time][crate::model::ListAssetsRequest::read_time].
        pub fn set_read_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_time][crate::model::ListAssetsRequest::read_time].
        pub fn set_or_clear_read_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.0.request.read_time = v.map(|x| x.into());
            self
        }

        /// Sets the value of [asset_types][crate::model::ListAssetsRequest::asset_types].
        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [content_type][crate::model::ListAssetsRequest::content_type].
        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
            self.0.request.content_type = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListAssetsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListAssetsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [relationship_types][crate::model::ListAssetsRequest::relationship_types].
        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListAssets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::batch_get_assets_history][crate::client::AssetService::batch_get_assets_history] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::BatchGetAssetsHistory;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BatchGetAssetsHistory {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BatchGetAssetsHistory(RequestBuilder<crate::model::BatchGetAssetsHistoryRequest>);

    impl BatchGetAssetsHistory {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BatchGetAssetsHistoryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::BatchGetAssetsHistoryResponse> {
            (*self.0.stub)
                .batch_get_assets_history(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::BatchGetAssetsHistoryRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [asset_names][crate::model::BatchGetAssetsHistoryRequest::asset_names].
        pub fn set_asset_names<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.asset_names = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [content_type][crate::model::BatchGetAssetsHistoryRequest::content_type].
        pub fn set_content_type<T: Into<crate::model::ContentType>>(mut self, v: T) -> Self {
            self.0.request.content_type = v.into();
            self
        }

        /// Sets the value of [read_time_window][crate::model::BatchGetAssetsHistoryRequest::read_time_window].
        pub fn set_read_time_window<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TimeWindow>,
        {
            self.0.request.read_time_window = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_time_window][crate::model::BatchGetAssetsHistoryRequest::read_time_window].
        pub fn set_or_clear_read_time_window<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TimeWindow>,
        {
            self.0.request.read_time_window = v.map(|x| x.into());
            self
        }

        /// Sets the value of [relationship_types][crate::model::BatchGetAssetsHistoryRequest::relationship_types].
        pub fn set_relationship_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.relationship_types = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BatchGetAssetsHistory {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::create_feed][crate::client::AssetService::create_feed] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::CreateFeed;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateFeed {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateFeed(RequestBuilder<crate::model::CreateFeedRequest>);

    impl CreateFeed {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateFeedRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Feed> {
            (*self.0.stub)
                .create_feed(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateFeedRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [feed_id][crate::model::CreateFeedRequest::feed_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_feed_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.feed_id = v.into();
            self
        }

        /// Sets the value of [feed][crate::model::CreateFeedRequest::feed].
        ///
        /// This is a **required** field for requests.
        pub fn set_feed<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Feed>,
        {
            self.0.request.feed = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [feed][crate::model::CreateFeedRequest::feed].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Feed>,
        {
            self.0.request.feed = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateFeed {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::get_feed][crate::client::AssetService::get_feed] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::GetFeed;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetFeed {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetFeed(RequestBuilder<crate::model::GetFeedRequest>);

    impl GetFeed {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetFeedRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Feed> {
            (*self.0.stub)
                .get_feed(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetFeedRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetFeed {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::list_feeds][crate::client::AssetService::list_feeds] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::ListFeeds;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListFeeds {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListFeeds(RequestBuilder<crate::model::ListFeedsRequest>);

    impl ListFeeds {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListFeedsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListFeedsResponse> {
            (*self.0.stub)
                .list_feeds(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::ListFeedsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListFeeds {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::update_feed][crate::client::AssetService::update_feed] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::UpdateFeed;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateFeed {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateFeed(RequestBuilder<crate::model::UpdateFeedRequest>);

    impl UpdateFeed {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateFeedRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Feed> {
            (*self.0.stub)
                .update_feed(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [feed][crate::model::UpdateFeedRequest::feed].
        ///
        /// This is a **required** field for requests.
        pub fn set_feed<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Feed>,
        {
            self.0.request.feed = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [feed][crate::model::UpdateFeedRequest::feed].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_feed<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Feed>,
        {
            self.0.request.feed = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateFeedRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateFeedRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateFeed {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::delete_feed][crate::client::AssetService::delete_feed] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::DeleteFeed;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteFeed {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteFeed(RequestBuilder<crate::model::DeleteFeedRequest>);

    impl DeleteFeed {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteFeedRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_feed(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteFeedRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteFeed {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::search_all_resources][crate::client::AssetService::search_all_resources] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::SearchAllResources;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SearchAllResources {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SearchAllResources(RequestBuilder<crate::model::SearchAllResourcesRequest>);

    impl SearchAllResources {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SearchAllResourcesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SearchAllResourcesResponse> {
            (*self.0.stub)
                .search_all_resources(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::SearchAllResourcesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::SearchAllResourcesResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [scope][crate::model::SearchAllResourcesRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [query][crate::model::SearchAllResourcesRequest::query].
        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.query = v.into();
            self
        }

        /// Sets the value of [asset_types][crate::model::SearchAllResourcesRequest::asset_types].
        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [page_size][crate::model::SearchAllResourcesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SearchAllResourcesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [order_by][crate::model::SearchAllResourcesRequest::order_by].
        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.order_by = v.into();
            self
        }

        /// Sets the value of [read_mask][crate::model::SearchAllResourcesRequest::read_mask].
        pub fn set_read_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_mask][crate::model::SearchAllResourcesRequest::read_mask].
        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SearchAllResources {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::search_all_iam_policies][crate::client::AssetService::search_all_iam_policies] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::SearchAllIamPolicies;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SearchAllIamPolicies {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SearchAllIamPolicies(RequestBuilder<crate::model::SearchAllIamPoliciesRequest>);

    impl SearchAllIamPolicies {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::SearchAllIamPoliciesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SearchAllIamPoliciesResponse> {
            (*self.0.stub)
                .search_all_iam_policies(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::SearchAllIamPoliciesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::SearchAllIamPoliciesResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [scope][crate::model::SearchAllIamPoliciesRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [query][crate::model::SearchAllIamPoliciesRequest::query].
        pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.query = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::SearchAllIamPoliciesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::SearchAllIamPoliciesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [asset_types][crate::model::SearchAllIamPoliciesRequest::asset_types].
        pub fn set_asset_types<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.asset_types = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [order_by][crate::model::SearchAllIamPoliciesRequest::order_by].
        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.order_by = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SearchAllIamPolicies {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_iam_policy][crate::client::AssetService::analyze_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeIamPolicy(RequestBuilder<crate::model::AnalyzeIamPolicyRequest>);

    impl AnalyzeIamPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalyzeIamPolicyResponse> {
            (*self.0.stub)
                .analyze_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [analysis_query][crate::model::AnalyzeIamPolicyRequest::analysis_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
        {
            self.0.request.analysis_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [analysis_query][crate::model::AnalyzeIamPolicyRequest::analysis_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
        {
            self.0.request.analysis_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [saved_analysis_query][crate::model::AnalyzeIamPolicyRequest::saved_analysis_query].
        pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.saved_analysis_query = v.into();
            self
        }

        /// Sets the value of [execution_timeout][crate::model::AnalyzeIamPolicyRequest::execution_timeout].
        pub fn set_execution_timeout<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.execution_timeout = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [execution_timeout][crate::model::AnalyzeIamPolicyRequest::execution_timeout].
        pub fn set_or_clear_execution_timeout<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.execution_timeout = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_iam_policy_longrunning][crate::client::AssetService::analyze_iam_policy_longrunning] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeIamPolicyLongrunning;
    /// # tokio_test::block_on(async {
    /// use lro::Poller;
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.poller().until_done().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeIamPolicyLongrunning {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeIamPolicyLongrunning(
        RequestBuilder<crate::model::AnalyzeIamPolicyLongrunningRequest>,
    );

    impl AnalyzeIamPolicyLongrunning {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeIamPolicyLongrunningRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        ///
        /// # Long running operations
        ///
        /// This starts, but does not poll, a longrunning operation. More information
        /// on [analyze_iam_policy_longrunning][crate::client::AssetService::analyze_iam_policy_longrunning].
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .analyze_iam_policy_longrunning(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Creates a [Poller][lro::Poller] to work with `analyze_iam_policy_longrunning`.
        pub fn poller(
            self,
        ) -> impl lro::Poller<
            crate::model::AnalyzeIamPolicyLongrunningResponse,
            crate::model::AnalyzeIamPolicyLongrunningMetadata,
        > {
            type Operation = lro::internal::Operation<
                crate::model::AnalyzeIamPolicyLongrunningResponse,
                crate::model::AnalyzeIamPolicyLongrunningMetadata,
            >;
            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);

            let stub = self.0.stub.clone();
            let mut options = self.0.options.clone();
            options.set_retry_policy(gax::retry_policy::NeverRetry);
            let query = move |name| {
                let stub = stub.clone();
                let options = options.clone();
                async {
                    let op = GetOperation::new(stub)
                        .set_name(name)
                        .with_options(options)
                        .send()
                        .await?;
                    Ok(Operation::new(op))
                }
            };

            let start = move || async {
                let op = self.send().await?;
                Ok(Operation::new(op))
            };

            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
        }

        /// Sets the value of [analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::analysis_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_analysis_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
        {
            self.0.request.analysis_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::analysis_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_analysis_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisQuery>,
        {
            self.0.request.analysis_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [saved_analysis_query][crate::model::AnalyzeIamPolicyLongrunningRequest::saved_analysis_query].
        pub fn set_saved_analysis_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.saved_analysis_query = v.into();
            self
        }

        /// Sets the value of [output_config][crate::model::AnalyzeIamPolicyLongrunningRequest::output_config].
        ///
        /// This is a **required** field for requests.
        pub fn set_output_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
        {
            self.0.request.output_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [output_config][crate::model::AnalyzeIamPolicyLongrunningRequest::output_config].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IamPolicyAnalysisOutputConfig>,
        {
            self.0.request.output_config = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeIamPolicyLongrunning {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_move][crate::client::AssetService::analyze_move] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeMove;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeMove {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeMove(RequestBuilder<crate::model::AnalyzeMoveRequest>);

    impl AnalyzeMove {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeMoveRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalyzeMoveResponse> {
            (*self.0.stub)
                .analyze_move(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [resource][crate::model::AnalyzeMoveRequest::resource].
        ///
        /// This is a **required** field for requests.
        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.resource = v.into();
            self
        }

        /// Sets the value of [destination_parent][crate::model::AnalyzeMoveRequest::destination_parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_destination_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.destination_parent = v.into();
            self
        }

        /// Sets the value of [view][crate::model::AnalyzeMoveRequest::view].
        pub fn set_view<T: Into<crate::model::analyze_move_request::AnalysisView>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.view = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeMove {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::query_assets][crate::client::AssetService::query_assets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::QueryAssets;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> QueryAssets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct QueryAssets(RequestBuilder<crate::model::QueryAssetsRequest>);

    impl QueryAssets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::QueryAssetsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::QueryAssetsResponse> {
            (*self.0.stub)
                .query_assets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::QueryAssetsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::QueryAssetsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::QueryAssetsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [timeout][crate::model::QueryAssetsRequest::timeout].
        pub fn set_timeout<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.timeout = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [timeout][crate::model::QueryAssetsRequest::timeout].
        pub fn set_or_clear_timeout<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Duration>,
        {
            self.0.request.timeout = v.map(|x| x.into());
            self
        }

        /// Sets the value of [output_config][crate::model::QueryAssetsRequest::output_config].
        pub fn set_output_config<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
        {
            self.0.request.output_config = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [output_config][crate::model::QueryAssetsRequest::output_config].
        pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::QueryAssetsOutputConfig>,
        {
            self.0.request.output_config = v.map(|x| x.into());
            self
        }

        /// Sets the value of [query][crate::model::QueryAssetsRequest::query].
        ///
        /// Note that all the setters affecting `query` are
        /// mutually exclusive.
        pub fn set_query<T: Into<Option<crate::model::query_assets_request::Query>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.query = v.into();
            self
        }

        /// Sets the value of [query][crate::model::QueryAssetsRequest::query]
        /// to hold a `Statement`.
        ///
        /// Note that all the setters affecting `query` are
        /// mutually exclusive.
        pub fn set_statement<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request = self.0.request.set_statement(v);
            self
        }

        /// Sets the value of [query][crate::model::QueryAssetsRequest::query]
        /// to hold a `JobReference`.
        ///
        /// Note that all the setters affecting `query` are
        /// mutually exclusive.
        pub fn set_job_reference<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_job_reference(v);
            self
        }

        /// Sets the value of [time][crate::model::QueryAssetsRequest::time].
        ///
        /// Note that all the setters affecting `time` are
        /// mutually exclusive.
        pub fn set_time<T: Into<Option<crate::model::query_assets_request::Time>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.time = v.into();
            self
        }

        /// Sets the value of [time][crate::model::QueryAssetsRequest::time]
        /// to hold a `ReadTimeWindow`.
        ///
        /// Note that all the setters affecting `time` are
        /// mutually exclusive.
        pub fn set_read_time_window<
            T: std::convert::Into<std::boxed::Box<crate::model::TimeWindow>>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_read_time_window(v);
            self
        }

        /// Sets the value of [time][crate::model::QueryAssetsRequest::time]
        /// to hold a `ReadTime`.
        ///
        /// Note that all the setters affecting `time` are
        /// mutually exclusive.
        pub fn set_read_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request = self.0.request.set_read_time(v);
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for QueryAssets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::create_saved_query][crate::client::AssetService::create_saved_query] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::CreateSavedQuery;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateSavedQuery {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateSavedQuery(RequestBuilder<crate::model::CreateSavedQueryRequest>);

    impl CreateSavedQuery {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateSavedQueryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SavedQuery> {
            (*self.0.stub)
                .create_saved_query(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateSavedQueryRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [saved_query][crate::model::CreateSavedQueryRequest::saved_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_saved_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SavedQuery>,
        {
            self.0.request.saved_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [saved_query][crate::model::CreateSavedQueryRequest::saved_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SavedQuery>,
        {
            self.0.request.saved_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [saved_query_id][crate::model::CreateSavedQueryRequest::saved_query_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_saved_query_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.saved_query_id = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateSavedQuery {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::get_saved_query][crate::client::AssetService::get_saved_query] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::GetSavedQuery;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSavedQuery {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSavedQuery(RequestBuilder<crate::model::GetSavedQueryRequest>);

    impl GetSavedQuery {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetSavedQueryRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SavedQuery> {
            (*self.0.stub)
                .get_saved_query(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetSavedQueryRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSavedQuery {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::list_saved_queries][crate::client::AssetService::list_saved_queries] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::ListSavedQueries;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSavedQueries {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSavedQueries(RequestBuilder<crate::model::ListSavedQueriesRequest>);

    impl ListSavedQueries {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListSavedQueriesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSavedQueriesResponse> {
            (*self.0.stub)
                .list_saved_queries(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSavedQueriesResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListSavedQueriesRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListSavedQueriesRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListSavedQueriesRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListSavedQueriesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSavedQueries {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::update_saved_query][crate::client::AssetService::update_saved_query] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::UpdateSavedQuery;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSavedQuery {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSavedQuery(RequestBuilder<crate::model::UpdateSavedQueryRequest>);

    impl UpdateSavedQuery {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateSavedQueryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SavedQuery> {
            (*self.0.stub)
                .update_saved_query(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [saved_query][crate::model::UpdateSavedQueryRequest::saved_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_saved_query<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SavedQuery>,
        {
            self.0.request.saved_query = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [saved_query][crate::model::UpdateSavedQueryRequest::saved_query].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_saved_query<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SavedQuery>,
        {
            self.0.request.saved_query = v.map(|x| x.into());
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateSavedQueryRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateSavedQueryRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSavedQuery {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::delete_saved_query][crate::client::AssetService::delete_saved_query] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::DeleteSavedQuery;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSavedQuery {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSavedQuery(RequestBuilder<crate::model::DeleteSavedQueryRequest>);

    impl DeleteSavedQuery {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteSavedQueryRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_saved_query(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteSavedQueryRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSavedQuery {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::batch_get_effective_iam_policies][crate::client::AssetService::batch_get_effective_iam_policies] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::BatchGetEffectiveIamPolicies;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> BatchGetEffectiveIamPolicies {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct BatchGetEffectiveIamPolicies(
        RequestBuilder<crate::model::BatchGetEffectiveIamPoliciesRequest>,
    );

    impl BatchGetEffectiveIamPolicies {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::BatchGetEffectiveIamPoliciesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::BatchGetEffectiveIamPoliciesResponse> {
            (*self.0.stub)
                .batch_get_effective_iam_policies(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [scope][crate::model::BatchGetEffectiveIamPoliciesRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [names][crate::model::BatchGetEffectiveIamPoliciesRequest::names].
        ///
        /// This is a **required** field for requests.
        pub fn set_names<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for BatchGetEffectiveIamPolicies {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_org_policies][crate::client::AssetService::analyze_org_policies] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeOrgPolicies;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeOrgPolicies {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeOrgPolicies(RequestBuilder<crate::model::AnalyzeOrgPoliciesRequest>);

    impl AnalyzeOrgPolicies {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeOrgPoliciesRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalyzeOrgPoliciesResponse> {
            (*self.0.stub)
                .analyze_org_policies(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::AnalyzeOrgPoliciesResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::AnalyzeOrgPoliciesResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [scope][crate::model::AnalyzeOrgPoliciesRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [constraint][crate::model::AnalyzeOrgPoliciesRequest::constraint].
        ///
        /// This is a **required** field for requests.
        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.constraint = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::AnalyzeOrgPoliciesRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::AnalyzeOrgPoliciesRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPoliciesRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::AnalyzeOrgPoliciesRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicies {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_org_policy_governed_containers][crate::client::AssetService::analyze_org_policy_governed_containers] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeOrgPolicyGovernedContainers;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeOrgPolicyGovernedContainers {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeOrgPolicyGovernedContainers(
        RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>,
    );

    impl AnalyzeOrgPolicyGovernedContainers {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedContainersRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(
            self,
        ) -> Result<crate::model::AnalyzeOrgPolicyGovernedContainersResponse> {
            (*self.0.stub)
                .analyze_org_policy_governed_containers(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<
            crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
            gax::error::Error,
        > {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::AnalyzeOrgPolicyGovernedContainersResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [scope][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [constraint][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::constraint].
        ///
        /// This is a **required** field for requests.
        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.constraint = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::AnalyzeOrgPolicyGovernedContainersRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedContainers {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::analyze_org_policy_governed_assets][crate::client::AssetService::analyze_org_policy_governed_assets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::AnalyzeOrgPolicyGovernedAssets;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AnalyzeOrgPolicyGovernedAssets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AnalyzeOrgPolicyGovernedAssets(
        RequestBuilder<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>,
    );

    impl AnalyzeOrgPolicyGovernedAssets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::AnalyzeOrgPolicyGovernedAssetsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AnalyzeOrgPolicyGovernedAssetsResponse> {
            (*self.0.stub)
                .analyze_org_policy_governed_assets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<
            crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
            gax::error::Error,
        > {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::AnalyzeOrgPolicyGovernedAssetsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [scope][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::scope].
        ///
        /// This is a **required** field for requests.
        pub fn set_scope<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.scope = v.into();
            self
        }

        /// Sets the value of [constraint][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::constraint].
        ///
        /// This is a **required** field for requests.
        pub fn set_constraint<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.constraint = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::AnalyzeOrgPolicyGovernedAssetsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AnalyzeOrgPolicyGovernedAssets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [AssetService::get_operation][crate::client::AssetService::get_operation] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_asset_v1::builder;
    /// use builder::asset_service::GetOperation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetOperation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);

    impl GetOperation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::AssetService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<longrunning::model::Operation> {
            (*self.0.stub)
                .get_operation(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetOperation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
